/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-05-04 09:50:21
 * @LastEditTime : 2023-06-18 10:19:49
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Router\MenuNav\FirstLevel\PersonExamination.jsx
 * @Description  :
 */
import { API_LIST } from '../../../Api/Api'
import { commonTableList } from '../Common/common'
import { DelDataButton } from '../Common/options'

export const PersonExamination = async ({ url, OptionsEvent, ClientData, Permission, actionRef }) => {
    let data = {
        pageSize: 10,
        params: { pageIndex: 1, OrderField: 'TableName@desc ,score@desc' },
        get: API_LIST()[`get${url}`],
        added: `pos${url}`,
        modify: `put${url}`,
        delete: `del${url}`,
        columns: [
            commonTableList.uuid,
            {
                dataIndex: 'tableName',
                title: '年月',
                valueType: 'input',
                rules: true,
                width: 100,
            },
            {
                dataIndex: 'personName',
                title: '姓名',
                valueType: 'input',
                rules: true,
                width: 100,
            },
            {
                dataIndex: 'personId',
                title: '人员编号',
                valueType: 'input',
                rules: true,
                width: 100,
            },
            {
                dataIndex: 'score',
                title: '得分',
                valueType: 'input',
                rules: true,
                width: 100,
                hideInSearch: true,
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 100,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        <DelDataButton
                            OptionsEvent={OptionsEvent}
                            key="del"
                            title="删除"
                            url={url}
                            uuid={record.uuid}
                        />,
                    ]
                },
            },
        ],
    }

    return data
}
